package api

import (
	"github.com/gogf/gf/net/ghttp"
	"shrimp-blog-server/app/model"
)

func (*apiMessages) Get(request *ghttp.Request) {
	messageService.GetModelById(request, getQueryParamID(request)...)
}

func (*apiMessages) Post(request *ghttp.Request) {
	var messages []model.Messages
	_ = request.Parse(&messages)
	messageService.AddMessage(request, messages...)
}

func (*apiMessages) Put(request *ghttp.Request) {
	responses.ErrorResponseExit(request, "留言不支持更新操作")
}

func (*apiMessages) Delete(request *ghttp.Request) {
	responses.ErrorResponseExit(request, "留言不支持删除操作")
}
